Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • trfletch 595 posts 571 karma points
    Mar 10, 2009 @ 22:27
    trfletch
    0

    Dropdown List Menu that shows nodes and sub nodes [SOLVED]

    I want to create a dropdown list that acts as a menu and shows nodes and sub nodes. For example I currently have nodes as follows:

    Test Section 1
    -Sub section 1
    -Sub section 1
    -Sub section 1
    Test Section 2
    -Sub section A
    -Sub section B

    I want the dropdown menu to look the same as above and I currently have the following code which works but it just shows "Test Section 1" and "Test Section 2", so all I want to know is how it then lists the child nodes below those sections as shown above with links to the pages. Here is what I have so far:



    [code]


    [/code]

  • trfletch 595 posts 571 karma points
    Mar 11, 2009 @ 13:02
    trfletch
    0

    Anybody got any suggestions on this one?

    I was hoping it was going to be fairly straight forward because I have been reading other posts where people want to get Pages and Sub Pages listed, this is similar but I just want them listed in the dropdown menu instead of on the page or in a normal menu and I'm not sure what code to use or how to arrange it to do so.

  • Kjeldsen 11 posts 25 karma points
    Apr 21, 2009 @ 01:03
    Kjeldsen
    0

    Hi,

    You might get help from this post.

    http://forum.umbraco.org/yafpostst8993List-entire-structure-from-changeable-source.aspx

    Essentially, you are creating "just another sitemap", packaged in a different HTML markup than usual.

    Brgds.
    Anders

  • Warren Buckley 2089 posts 4578 karma points MVP ∞ admin hq c-trib
    Apr 21, 2009 @ 08:48
    Warren Buckley
    0

    Hi Tony your Xpath is specifically saying get only the first level of children underneath the Source parameter.

    You can ammend your Xpath to this

    [code]
    umbraco.library:GetXmlNodeById($source)//node [string(data [@alias='umbracoNaviHide']) != '1']
    [/code]

    The difference is the // in this xpath which will look for all nodes no matter how many children deep it is, however if you have child nodes underneath Sub Section 1 for example it will alos list those.

    So you could then modify the xPath again to list all child nodes with a particular match for example a specific documentType alias.

    [code]
    umbraco.library:GetXmlNodeById($source)//node [string(data [@alias='umbracoNaviHide']) != '1' and @nodeTypeAlias = 'yourNodeTypeAlias']
    [/code]

    I hope this helps you out.
    If you need any more help let me know.

    Warren

  • trfletch 595 posts 571 karma points
    Apr 21, 2009 @ 10:56
    trfletch
    0

    Hi Warren,

    Thank you for your help, I managed to get this working the way I wanted with the following code, sorry I should have updated this post but I completely forgot about it, the current issue I am having is in this post http://forum.umbraco.org/yafpostsm44708Next-and-previous-links-to-Pagesnodes-on-same-level.aspx#44708 if you are able to offer any advice.

    This is the XSLT that I used for my dropdown menu:

    [code]


    I want more info about...








    [/code]

  • Warren Buckley 2089 posts 4578 karma points MVP ∞ admin hq c-trib
    Apr 21, 2009 @ 10:59
    Warren Buckley
    0

    OK glad you sorted it.

    Can you edit your recent post so you can update the forum post title to append [SOLVED] to it. SO people can see find threads that are solved easily.

    Thanks,
    Warren

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies